package com.com.hefei.wdp.example.service;

import com.netflix.hystrix.contrib.javanica.annotation.DefaultProperties;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;

@Component
//value： 服务名，调用的是哪个服务提供者 ;fallback:服务降级熔断类
@FeignClient(value = "PRODUCER",fallback = HystrixFallback.class)
//@FeignClient(value = "PRODUCER",fallbackFactory = HystrixFallbackFactory.class)
public interface ProducerService {

    @GetMapping("/appInfo")
//    @HystrixCommand(commandProperties = {
//            @HystrixProperty(name="execution.isolation.thread.timeoutInMilliseconds",value="1000") //超过三秒
//    })
    public String getAppInfo();


}
